package com.mes.code.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.context.annotation.Lazy;

import com.mes.common.domain.BasicModel;



/**
 * CSncode generated by MyEclipse Persistence Tools
 *author lcs
 *data 2017-03-29
 */
@Entity()
//@org.hibernate.annotations.Entity(dynamicInsert=true,dynamicUpdate=true)
@Table(name = "C_SNCODE")
@BatchSize(size=10)
@Lazy(value=true)
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class SerialNumber extends BasicModel implements Serializable {
	
	@Id
	@GenericGenerator(name = "snUid", strategy = "assigned")
	@Column(name = "SNUID")
	private String snUid;
	
	@Override
	public String getUuid() {
		return snUid;
	}

	@Override
	public void setUuid(String uuid) {
		this.snUid = uuid;
	}
	

	public String getSnUid() {
		return snUid;
	}

	public void setSnUid(String snUid) {
		this.snUid = snUid;
	}


	// Fields
	@Column(name="MIN",length=38)
	private Long min;
	
	@Column(name="MAX",length=38)
	private Long max;
	
	@Column(name="LAST",length=38)
	private Long last;
	
	@Column(name="INTERVAL",length=38)
	private Long interval;
	
	@Column(name="FEATURES",length=500)
	private String features;
	
	@Column(name="FEATURES_FORMAT",length=500)
	private String featuresFormat;
	
	@Column(name="SNUIDTYPE",length=38)
	private String snUidType;
	
	@Column(name="CRUID",length=38)
	private String codeRuleUid;
	
	//many-to-one
	@ForeignKey(name="null")
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="CRUID",insertable=false,updatable=false)
	private CodeRule codeRule;

	public String getSnUidType() {
		return snUidType;
	}

	public void setSnUidType(String snUidType) {
		this.snUidType = snUidType;
	}

	public Long getMin() {
		return min;
	}

	public void setMin(Long min) {
		this.min = min;
	}

	public Long getMax() {
		return max;
	}

	public void setMax(Long max) {
		this.max = max;
	}

	public Long getLast() {
		return last;
	}

	public void setLast(Long last) {
		this.last = last;
	}

	public Long getInterval() {
		return interval;
	}

	public void setInterval(Long interval) {
		this.interval = interval;
	}

	public String getFeatures() {
		return features;
	}

	public void setFeatures(String features) {
		this.features = features;
	}

	public String getFeaturesFormat() {
		return featuresFormat;
	}

	public void setFeaturesFormat(String featuresFormat) {
		this.featuresFormat = featuresFormat;
	}

	public CodeRule getCodeRule() {
		return codeRule;
	}

	public void setCodeRule(CodeRule codeRule) {
		this.codeRule = codeRule;
	}

	public String getCodeRuleUid() {
		return codeRuleUid;
	}

	public void setCodeRuleUid(String codeRuleUid) {
		this.codeRuleUid = codeRuleUid;
	}
	
}